import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
// import provide
import { provide } from 'vue' 
import 'animate.css';
import axios from 'axios'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


const app = createApp(App)

// app.use(createPinia())
const pinia=createPinia()
app.use(pinia)
pinia.use(piniaPluginPersistedstate)
app.use(router)
app.use(ElementPlus)
// app.use(axios)
//provide一个只读的属性name
app.provide('name', 'mxy')
app.provide('$axios', axios)
axios.defaults.baseURL = 'http://localhost:3000/';
app.mount('#app')
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
